// !@#$McCaBe-InStRuMeNtAtIoN$#@!
// Instrumented with the McCabe Java Parser
// Version: 8.1.0.1 - 20110309
// Using Path Vector Instrumentation
// Date: Sun Apr 01 2012 20:40:05
package EventManager;

import java.util.Date;

import Driver.Facade;
import Model.Event;
import Model.EventSpecification;
import Model.EventStatus;
import Model.VenueTimeslot;

import com.mccabe.*;


class CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569 {
    static java.lang.Object info[];
    static {
        info = new java.lang.Object[2];
        info[0] = new Integer(-1);
        info[1] = new String("R:\\yu\\Concordia\\SOEN 344 Design II\\Term Assignment\\Code Repo\\trunk\\Iteration 3\\ERS\\src\\EventManager\\CreateEventAdminRequest.java");
    }
}


/**
 * Administrator-level request that creates an event.
 * 
 * @author Yury Kitaev
 *
 */
public class CreateEventAdminRequest extends AdminRequest
{
	private Date date; // date and time
	private int duration; // in minutes
	private int capacity; // in persons
	private String title; 
	private VenueTimeslot venue;
	
	/**
	 * Constructor, similar to that of Event class
	 * @param title
	 * @param date
	 * @param duration
	 * @param capacity
	 * @param venue
	 * @param issuer
	 */
	public CreateEventAdminRequest(String title, Date date, int duration, int capacity, VenueTimeslot venue, Administrator issuer) 
	{
		super(issuer);
int _mcFreq_5ab6d80b6764fe454a39ec5de72b3e24[] = PathVec_ERS_Iter3.getIntArray(0);
PathVec_ERS_Iter3.releaseIntArray();
PathVec_ERS_Iter3.enterConstructorWithECC(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,0,_mcFreq_5ab6d80b6764fe454a39ec5de72b3e24,0);

		this.date = date;
		this.duration = duration;
		this.capacity = capacity;
		this.title = title;
		this.venue = venue;
	}

	public Date getDate() 
	{
int _mcFreq_45fc8edc4c9a1dabe7ecc9e15841e1a0[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,1,_mcFreq_45fc8edc4c9a1dabe7ecc9e15841e1a0,0);

		return date;
	}

	public void setDate(Date date) 
	{
int _mcFreq_72058d0ff268bf59763a69adcb6223e0[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,2,_mcFreq_72058d0ff268bf59763a69adcb6223e0,0);

		this.date = date;
	}


	public int getDuration() 
	{
int _mcFreq_5cedf4fd171f884f304652649985b35e[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,3,_mcFreq_5cedf4fd171f884f304652649985b35e,0);

		return duration;
	}


	public void setDuration(int duration) 
	{
int _mcFreq_07bbf019eafdd2f056ad192823cbb46e[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,4,_mcFreq_07bbf019eafdd2f056ad192823cbb46e,0);

		this.duration = duration;
	}


	public int getCapacity() 
	{
int _mcFreq_887b098ba871e980dd471741f65c3cd9[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,5,_mcFreq_887b098ba871e980dd471741f65c3cd9,0);

		return capacity;
	}


	public void setCapacity(int capacity) 
	{
int _mcFreq_97525a368386b70f524963638df0dc4b[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,6,_mcFreq_97525a368386b70f524963638df0dc4b,0);

		this.capacity = capacity;
	}


	public String getTitle() 
	{
int _mcFreq_436b3b9f5b8e18f56deb64b41cd7170e[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,7,_mcFreq_436b3b9f5b8e18f56deb64b41cd7170e,0);

		return title;
	}


	public void setTitle(String title) 
	{
int _mcFreq_2b19e8dfa7f9c3ffca78370729c177a5[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,8,_mcFreq_2b19e8dfa7f9c3ffca78370729c177a5,0);

		this.title = title;
	}


	public VenueTimeslot getVenue() 
	{
int _mcFreq_4c88668e08179f8b114a7bdb8c2f00d4[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,9,_mcFreq_4c88668e08179f8b114a7bdb8c2f00d4,0);

		return venue;
	}


	public void setVenue(VenueTimeslot venue) 
	{
int _mcFreq_2ceeb4df6e7ce7f8987adca366d852a0[] = new int[1];
PathVec_ERS_Iter3.enterMethod(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,10,_mcFreq_2ceeb4df6e7ce7f8987adca366d852a0,0);

		this.venue = venue;
	}

	@Override
	public void process(Administrator issuer) 
	{
int _mcFreq_c94ca6d3b7aa52aa2d15d1c727aa9c9f[] = new int[4];
PathVec_ERS_Iter3.enterMethod(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,11,_mcFreq_c94ca6d3b7aa52aa2d15d1c727aa9c9f,0);

		
{boolean __MCCABE_SKIPNEXT_EVENT_27 = false;
try {try
		{
			super.process(issuer);
			setIssuer(issuer);
			EventSpecification spec  = new EventSpecification(title, true);
			Event e = new Event(date, duration, capacity, spec, EventStatus.Open, venue );
			Facade.getCatalog().getEvents().add(e);
			setStatus(RequestStatus.Sustained);
		}
		catch (Exception e)
		{
PathVec_ERS_Iter3.decision(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,11,_mcFreq_c94ca6d3b7aa52aa2d15d1c727aa9c9f,1,0,true);
__MCCABE_SKIPNEXT_EVENT_27 = true;

			setStatus(RequestStatus.Refused);
		}
if (!__MCCABE_SKIPNEXT_EVENT_27)

PathVec_ERS_Iter3.decision(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,11,_mcFreq_c94ca6d3b7aa52aa2d15d1c727aa9c9f,3,0,true);
__MCCABE_SKIPNEXT_EVENT_27 = true;

} finally {
    if (!__MCCABE_SKIPNEXT_EVENT_27)
        PathVec_ERS_Iter3.decision(CreateEventAdminRequest_b140911cca1e73fc34dc3601e68ff569.info,11,_mcFreq_c94ca6d3b7aa52aa2d15d1c727aa9c9f,2,0,true);
}}

	}
}
